#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
#include <stdbool.h>


struct TreeNode {
    int val;
    struct TreeNode* left;
    struct TreeNode* right;
};

bool isSameTree(struct TreeNode* rootleft, struct TreeNode* rootright)
{
    if (rootright == NULL)
        return true;
    else
        if (rootleft == NULL)
            return false;
    return rootleft->val == rootright->val &&
        isSameTree(rootleft->left, rootright->left) &&
        isSameTree(rootleft->right, rootright->right);

}

bool isSameTree(struct TreeNode* rootleft, struct TreeNode* rootright)
{
    if (rootright == NULL && rootleft == NULL)
        return true;
    if (rootright == NULL || rootleft == NULL)
        return false;
    return rootleft->val == rootright->val &&
        isSameTree(rootleft->left, rootright->left) &&
        isSameTree(rootleft->right, rootright->right);

}


bool isSubtree(struct TreeNode* root, struct TreeNode* subRoot)
{
    if (subRoot == NULL)
        return true;
    if (root == NULL)
        return false;
    return isSameTree(root, subRoot) || isSubtree(root->left, subRoot) || isSubtree(root->right, subRoot);
}


int main()
{
return 0;
}